package com.example.util;

import com.example.entity.Entity;
import com.example.entity.ParentEntity;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Arrays;

public class TestInstance {
    public static void main(String[] args) {

        Class<?> c = Entity.class;
        try {
            Method method = c.getMethod("setName",String.class);
            Annotation[][] arg = method.getParameterAnnotations();
            System.out.println(arg);
            System.out.println(arg.length);
            System.out.println(arg[0].length);
            System.out.println(Arrays.toString(arg[0]));//默认为[]
            //System.out.println(arg[0][0]);
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
//        Entity e = new Entity();
//        ParentEntity parentEntity = new ParentEntity();
//        ParentEntity entity = new Entity();
//        System.out.println(entity.getClass());
//        System.out.println(e instanceof ParentEntity);
//
//        System.out.println(parentEntity instanceof Entity);
//
//        System.out.println(entity instanceof Entity);
    }
}
